package org.dey.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.dey.pojo.CheckGroup;
import org.dey.pojo.Setmeal;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author hg
 * @date 2022/3/15
 * @classname
 */
@Repository
public interface SetmealMapper extends BaseMapper<Setmeal> {

    @Select(" SELECT code FROM t_setmeal ORDER BY id DESC LIMIT 0,1")
    Setmeal getSetmeal();

    @Insert("insert into t_setmeal_checkgroup values (#{id},#{id1}) ")
    int tctjjcz(@Param("id") int id, @Param("id1") Integer id1);

    @Select("select t.* from t_setmeal_checkgroup a inner join t_checkgroup t on a.checkgroup_id=t.id where a.setmeal_id=#{id}")
    List<CheckGroup> ckjianchazu(int id);
}
